]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Use icon grid size as distance passed to SwipeTracker
authorJonas Dreßler <verdre@v0yd.nl>
Sat, 9 Apr 2022 22:48:39 +0000 (00:48 +0200)
committerMarge Bot <marge-bot@gnome.org>
Sun, 24 Apr 2022 12:53:50 +0000 (12:53 +0000)
The swipeTracker wants the distance between two pages passed to it in
confirmSwipe(). In case of the app grid, the correct distance is not the
size of the scrollView (which has the width of the whole screen), but
instead the allocation size of the iconGrid (which is the actual size
of a page in the grid).

So pass the allocation size of the iconGrid to the swipeTracker, this
makes sure the pages move perfectly in sync with the pointer when
dragging using the mouse or touchscreen.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2275>

js/ui/appDisplay.js

index 62d0c9c1cebf4ee83a44473ff6011278d8ab3430..dd75a09edd6e4ac8528d34db91b2ff570ebbb1b9 100644 (file)
@@ -523,7 +523,7 @@ var BaseAppView = GObject.registerClass({
         const progress = adjustment.value / adjustment.page_size;
         const points = Array.from({ length: this._grid.nPages }, (v, i) => i);
         const size = tracker.orientation === Clutter.Orientation.VERTICAL
-            ? this._scrollView.height : this._scrollView.width;
+            ? this._grid.allocation.get_height() : this._grid.allocation.get_width();
 
         tracker.confirmSwipe(size, points, progress, Math.round(progress));
     }